package com.example.keli.ui.reward;

import android.content.Context;
import android.widget.ImageView;
import android.widget.TextView;

import com.bumptech.glide.Glide;
import com.example.keli.R;
import com.example.keli.base.adapter.RecyclerAdapter;
import com.example.keli.base.adapter.RecyclerViewHolder;

import java.util.List;

/**
 * description $desc$
 * created by jerry on 2019/3/18.
 */
public class RewardRankAdapter extends RecyclerAdapter<RewardDetailsActivity.RewardRank> {

    private Context mContext;

    public RewardRankAdapter(Context context, int layoutId, List<RewardDetailsActivity.RewardRank> datas) {
        super(context, layoutId, datas);
        this.mContext = context;
    }

    @Override
    public void convert(final RecyclerViewHolder hepler, final RewardDetailsActivity.RewardRank rewardVO) {
        TextView rank = hepler.getView(R.id.tv_reward_rank);
        TextView info = hepler.getView(R.id.tv_reward_info);
        ImageView imageView = hepler.getView(R.id.iv_reward_rank);

        Glide.with(mContext).load(rewardVO.getImg()).into(imageView);
        rank.setText(rewardVO.getTitle());
        info.setText(rewardVO.getContent());

    }
}
